/**
 * Copyright 2014 Viettel Telecom. All rights reserved.
 * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.viettel.core.enumtype;

import java.util.HashMap;
import java.util.Map;

/**
 * Mo ta muc dich cua lop (interface)
 * 
 * @author: TOANTM1
 * @version:
 * @since: 27/02/2014 - 11:34:02
 */
public enum MediaStatus {

	DELETED(-1), // xoa
	HIDE(0), // an
	VISIBLE(1); // hien thi

	/** The value. */
	private Integer value;

	/** The values. */
	private static Map<Integer, MediaStatus> values = null;

	/**
	 * Gets the value.
	 * 
	 * @return the value
	 */
	public Integer getValue() {
		return value;
	}

	/**
	 * Instantiates a new gender type.
	 * 
	 * @param value
	 *            the value
	 */
	MediaStatus(Integer value) {
		this.value = value;
	}

	/**
	 * Parses the value.
	 * 
	 * @param value
	 *            the value
	 * @return the gender type
	 */
	public static MediaStatus parseValue(Integer value) {
		if (value != null && value == -1) {
			value = -1;
		}
		if (values == null) {
			values = new HashMap<Integer, MediaStatus>(
					MediaStatus.values().length);
			for (MediaStatus e : MediaStatus.values())
				values.put(e.getValue(), e);
		}
		return values.get(value);
	}
}
